#ifndef _VERSION_H__
#define _VERSION_H__

#include <stdio.h>

#define COREUTILS_NAME "dm9pZCAq coreutils"

#ifndef PROG_NAME
#	ifndef __clang_analyzer__
#		error PROG_NAME not defined
#	else
#		define PROG_NAME "<_clang_check__>"
#	endif
#endif /* PROG_NAME */

#ifndef VERSION
#	ifndef __clang_analyzer__
#		error VERSION not defined
#	else
#		define VERSION "<_clang_check__>"
#	endif
#endif /* VERSION */

#ifdef EXTRA_VERSION
#	define print_extra_version() fputs(EXTRA_VERSION)
#else
#	define print_extra_version() NULL
#endif /* EXTRA_VERSION */

#define print_version()                                                       \
	printf("%s (%s) %s\n", PROG_NAME, COREUTILS_NAME, VERSION);           \
	print_extra_version()

#endif /* _VERSION_H__ */
